import { defineStore } from "pinia";
import { useKeepAliveStore } from "./keepAlive";
import { TabsState, TabsMenuProps, menusState, MenusProps } from "@/stores/interface";
import piniaPersistConfig from "@/stores/helper/persist";

const keepAliveStore = useKeepAliveStore();

export const useMenusStore = defineStore({
  id: "my-menus",
  state: (): menusState => ({
    childrenMenus: []
  }),
  actions: {
    // Add Tabs
    async saveChildrenMenus(childrenMenus) {
      this.childrenMenus = childrenMenus
    }
  },
  persist: piniaPersistConfig("my-menus")
});
